<?php


namespace app\metrics;


class MetricsCollector
{
    private MetricsStorage $metricsStorage;

    public function __construct(MetricsStorage $metricsStorage)
    {
        $this->metricsStorage = $metricsStorage;
    }

    public function recordRequest(RequestInfo $requestInfo)
    {
        if ($requestInfo == null || empty($requestInfo->getApiName())) {
            return;
        }
        $this->metricsStorage->saveRequestInfo($requestInfo);
    }
}